"""
@-*- coding: utf-8 -*-
@ python: 3.12.3
@ 创建者: JacksonCode
@ 创建时间: 2024/12/21
"""
import numpy as np

# zeros ones
array = np.zeros(3)
print(array)
arrayOnes = np.ones(3)
print(arrayOnes)

array = np.zeros((3, 3))
print(array)

ArrayOnes = np.ones((3, 3))
print(ArrayOnes)

a_list = np.ones((3, 3)) * 8
print(a_list)

a_list2 = np.ones((3, 3), dtype=np.float32)
print(a_list2)

x = np.empty(5)
print(x)
print(x.shape)

x.fill(1)
print(x)

arrays = np.array([1, 2, 3, 4, 5])
print(arrays)

arr = np.zeros_like(arrays)
print(arr)

arrs = np.ones_like(arrays)
print(arrs)

print(np.identity(5))  # 单位矩阵
